<?php 
defined('LMO') or die('Can\'t access !'); 

class LCMessage {
    static $instance;
    
    public static function getInstance()
    {
        if(!isset(self::$instance)) {
            self::$instance = new LCMessage();
        }
        
        return self::$instance;
    }
    
    public function indexAction() 
    {
        $s = null;
        $type = 'ok';
        if(isset($_GET['type'])) {
            if($_GET['type'] == 'error') {
                $type = 'error';
            } else if($_GET['type'] == 'alert'){
                $type = 'alert';
            }
        }
        
        if(isset($_GET['s'])) {
            $s = $_GET['s'];
        }
        
        $layout = LLayout::getInstance();
        $html = $layout->assign('message', array('t' => $type, 's' => $s));
        $layout->loadLayout($html);
    }
}
?>